<!-- @format -->

<template>
  <div id="UserCenter">
    <van-nav-bar
      title="用户中心"
      style="height: 80px;
    background: aqua;color:white"
    >
      <template #right>
        <div style="">
          <i
            class="iconfont icon-erweima"
            style="margin-right:10px;font-size:20px;color:white"
          ></i>
          <i
            class="iconfont icon-shezhi"
            style="font-size:20px;color:white"
          ></i>
        </div> </template
    ></van-nav-bar>

    <div class="usercell">
      <div class="left">
        <img
          src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201905%2F28%2F20190528143150_fETNW.thumb.700_0.jpeg&refer=http%3A%2F%2Fb-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1619002062&t=f51a79590f8c8012a92b98a2af72ac13"
          alt=""
        />
      </div>
      <div class="center">
        <h5>151369658</h5>
        <p>昵称：{{ nickname }}</p>
      </div>
      <div class="right">
        <span>优惠券</span>
      </div>
    </div>

    <div class="order">
      <van-cell title="我的订单" is-link style="padding:20px;font-size:20px">
        <template #label>
          <van-cell is-link>
            <template #title>
              <i class="iconfont icon-qianbao"></i>
              <span>待付款</span>
            </template>
            <!-- 使用 right-icon 插槽来自定义右侧图标 -->
          </van-cell>
          <van-cell is-link>
            <template #title>
              <i class="iconfont icon-liwu"></i>
              <span>待发货</span>
            </template>
            <!-- 使用 right-icon 插槽来自定义右侧图标 -->
          </van-cell>
          <van-cell is-link>
            <template #title>
              <i class="iconfont icon-fahuo"></i>
              <span>待收货</span>
            </template>
            <!-- 使用 right-icon 插槽来自定义右侧图标 -->
          </van-cell>
          <van-cell is-link>
            <template #title>
              <i class="iconfont icon-pingtai"></i>
              <span>评价</span>
            </template>
            <!-- 使用 right-icon 插槽来自定义右侧图标 -->
          </van-cell>
          <van-cell is-link>
            <template #title>
              <i class="iconfont icon-kefu"></i>
              <span>售后</span>
            </template>
            <!-- 使用 right-icon 插槽来自定义右侧图标 -->
          </van-cell>
          <van-cell is-link @click="longinout">
            <template #title>
              <i class="iconfont icon-shanchu"></i>
              <span>退出登录</span>
            </template>
            <!-- 使用 right-icon 插槽来自定义右侧图标 -->
          </van-cell>
        </template>
        <!-- 使用 right-icon 插槽来自定义右侧图标 -->
      </van-cell>
    </div>
  </div>
</template>
<script>
import { get } from "@utils/request";
import Cookie from "js-cookie";
export default {
  data() {
    return {
      icon: "",
      nickname: ""
    };
  },
  created() {
    get("http://localhost:3000/address/showAddress").then(res => {
      console.log(res);
      this.icon = res.data.user.icon;
      this.nickname = res.data.user.nickname;
    });
  },
  methods: {
    longinout() {
      console.log(1);
      Cookie.remove("token");
      this.$router.push({ name: "login" });
    }
  }
};
</script>
<style lang="scss" scoped>
.custom-title {
  margin-left: 0.383795rem;
}
/deep/.van-nav-bar__title {
  color: white;
}
* {
  margin: 0;
  padding: 0;
}
.van-cell__right-icon {
  font-size: 15px;
}
.usercell {
  display: flex;
  width: 90%;
  margin: 0 auto;
  height: 80px;
  font-size: 16px;
  background: rgb(255, 255, 255);
  border-radius: 20px;
  position: relative;
  box-shadow: 0px 0px 2px 0px;
  top: -30px;
  z-index: 5;

  .left {
    width: 20%;
    img {
      border-radius: 50%;
      margin-top: 10px;
      margin-left: 10px;
    }
  }
  .center {
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    margin-left: 0.767591rem;
  }
  .right {
    width: 30%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    span {
      font-size: 12px;
      border: 1px solid;
      border-radius: 20px 0 0 20px;
      height: 30px;
      line-height: 30px;
      padding-right: 10px;
      background: #b44c02;
      text-align: center;
      color: white;
    }
  }
}
.order {
  box-shadow: 0px 0px 4px 0px;
  padding: 2px;
}
.van-cell {
  .van-cell__label {
    margin-left: 0.191898rem;
    margin-top: 0.383795rem;
    .van-cell {
      margin-top: 0.287847rem;
    }
    i {
      font-size: 25px;
    }
    .van-cell__right-icon {
      font-size: 15px;
    }
    span {
      margin-left: 0.287847rem;
      font-size: 16px;
    }
  }
}
</style>
